package example.rmi.server;

import example.rmi.server.handler.impl.UserServiceImpl;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 * @author Hao Yang
 */
public class RmiServerRunner {

    public static void main(String [] args) throws MalformedURLException, RemoteException {
        LocateRegistry.createRegistry(1099);
        Naming.rebind("rmi://localhost:1099/userService", UserServiceImpl.getInstance());
        System.out.println("Rmi server is ready...");
    }

}
